package com.asset.dispoal.configurationBatch;

import com.asset.dispoal.configurationBatch.api.ConfigurationBatchService;
import com.asset.dispoal.configurationBatch.dto.ConfigurationBatchRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;

/**
 * @author qr
 * @date 2022/3/25$
 */
@RestController
@Api(value = "匹配通用配置", tags = "匹配通用配置")
@RequestMapping("sys/configurationBatch")
public class ConfigurationBatchController {

    @Autowired
    ConfigurationBatchService configurationBatchService;

    @PostMapping("modifyConfigurationBatch")
    @ApiOperation(value = "设置", notes = "设置")
    public Result modifyConfigurationBatch(@RequestBody ConfigurationBatchRequest request) {
        return configurationBatchService.insert(request);
    }

    @GetMapping("query")
    @ApiOperation(value = "查询", notes = "查询")
    public Result query(String assetInstBatchId) {
        return configurationBatchService.query(assetInstBatchId);
    }

    @GetMapping("/queryById")
    @ApiOperation(value = "查询", notes = "查询")
    public Result queryById(String assetInstBatchId) {
        return configurationBatchService.queryById(assetInstBatchId);
    }
}